<template>
  <div id="app" v-if="isRefresh">
      <keep-alive>
          <router-view v-if="$route.meta.keepAlive" v-wechat-title="$route.meta.title"></router-view>
      </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" v-wechat-title="$route.meta.title"></router-view>
  </div>
</template>
<script>
export default {
  name: 'app',
  provide () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      isRefresh: true
    }
  },
  methods: {
    reload () {
      this.isRefresh = false
      this.$nextTick(() => {
        this.isRefresh = true
      })
    }
  }
}
</script>
<style lang="less">
body, html {
  height: 100%;
  width: 100%;
  background: #ddd;
}
#app {
  height: 100%;
  width: 100%;
  min-width: 1276px;
  overflow-x: scroll;
  background: #fff;
}
</style>
